package com.sid.oncf.entity;

// Generated 11 janv. 2015 08:34:52 by Hibernate Tools 3.4.0.CR1

import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * Voyages generated by hbm2java
 */
@Entity
@Table(name = "voyages", catalog = "db_test")
public class Voyages implements java.io.Serializable {

	private Integer idVoyage;
	private Gares garesByIdGareDepart;
	private Gares garesByIdGareArrivee;
	private Date heureArrivee;
	private Date heureDepart;

	public Voyages() {
	}

	public Voyages(Gares garesByIdGareDepart, Gares garesByIdGareArrivee,
			Date heureArrivee, Date heureDepart) {
		this.garesByIdGareDepart = garesByIdGareDepart;
		this.garesByIdGareArrivee = garesByIdGareArrivee;
		this.heureArrivee = heureArrivee;
		this.heureDepart = heureDepart;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "id_voyage", unique = true, nullable = false)
	public Integer getIdVoyage() {
		return this.idVoyage;
	}

	public void setIdVoyage(Integer idVoyage) {
		this.idVoyage = idVoyage;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "id_gare_depart", nullable = false)
	public Gares getGaresByIdGareDepart() {
		return this.garesByIdGareDepart;
	}

	public void setGaresByIdGareDepart(Gares garesByIdGareDepart) {
		this.garesByIdGareDepart = garesByIdGareDepart;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "id_gare_arrivee", nullable = false)
	public Gares getGaresByIdGareArrivee() {
		return this.garesByIdGareArrivee;
	}

	public void setGaresByIdGareArrivee(Gares garesByIdGareArrivee) {
		this.garesByIdGareArrivee = garesByIdGareArrivee;
	}

	@Temporal(TemporalType.TIME)
	@Column(name = "heure_arrivee", nullable = false, length = 8)
	public Date getHeureArrivee() {
		return this.heureArrivee;
	}

	public void setHeureArrivee(Date heureArrivee) {
		this.heureArrivee = heureArrivee;
	}

	@Temporal(TemporalType.TIME)
	@Column(name = "heure_depart", nullable = false, length = 8)
	public Date getHeureDepart() {
		return this.heureDepart;
	}

	public void setHeureDepart(Date heureDepart) {
		this.heureDepart = heureDepart;
	}

}
